package tc.jv.task10;

import tc.jv.task4.Vector;

public class RThreadWriter implements Runnable
{

	Vector vector;
	
	// CONSTRUCTORS
	
	public RThreadWriter(Vector v)
	{
		vector = v;
	}
	
	// METHODS
	
	public void run()
	{
		for (int i = 0; i < vector.size(); i++)
		{
			synchronized (vector)
			{
				vector.set(i, i+1);
				System.out.printf("Writing %f to %d\n", (double) (i+1), i);
			}
		}
	}
}
